local skel = fk.CreateSkill {
  name = "lb__liushang",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable {
  ["lb__liushang"] = "流熵",
  [":lb__liushang"] = "<b>锁定技</b>，游戏开始时，你减少任意点体力上限并从" ..
      "<a href=':lb__hongyan'><font color='red'>〖轰炎〗</font></a>、" ..
      "<a href=':lb__jiaotu'><font color='red'>〖焦土〗</font></a>、" ..
      "<a href=':lb__jianyuan'><font color='red'>〖茧源〗</font></a>中获得等量不同技能。",

  ["#lb__liushang"] = "流熵：你减少任意点体力上限并获得等量不同技能",

  ["$lb__liushang1"] = "火萤IV型，已就位。",
  ["$lb__liushang2"] = "没有退路，只能向前。",
  ["$lb__liushang3"] = "也许最后，我也能拥有自己的梦。",
}

skel:addEffect(fk.GameStart, {
  mute = true,
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skel.name)
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    local choices = room:askToChoices(player, {
      choices = { "lb__hongyan", "lb__jiaotu", "lb__jianyuan" },
      min_num = 1,
      max_num = 3,
      skill_name = skel.name,
      cancelable = true,
      prompt = "#lb__liushang",
    })
    event:setCostData(self, { choices = choices })
    return true
  end,
  on_use = function(self, event, target, player, data)
    player.room:notifySkillInvoked(player, skel.name, "masochism")
    local c = event:getCostData(self).choices
    if #c == 0 then
      player:broadcastSkillInvoke(skel.name, 3)
    else
      player:broadcastSkillInvoke(skel.name, math.random(1, 2))
      player.room:changeMaxHp(player, - #c)
      for _, s in ipairs(c) do
        player.room:handleAddLoseSkills(player, s)
      end
    end
  end,
})

return skel
